; sets
(def players #{"Alice", "Bob", "Kelly"})
(conj players "Fred")
(disj players "Bob" "Sal")
(contains? players "Kelly")
(conj (sorted-set) "Bravo" "Charlie" "Sigma" "Alpha")

; into
(def players #{"Alice" "Bob" "Kelly"})
(def new-players ["Tim" "Sue" "Greg"])
(into players new-players)

; map
(def scores {"Fred" 1400
             "Bob" 1240
             "Angela" 1024})
(assoc scores "Sally" 0)
(dissoc scores "Bob")
(get scores "Angela")
(def directions {:north 1
                        :east 1
                        :south 2
                        :west 3})
(directions :northa)
(get scores "Sam" 0)
(directions :northest -1)
(contains? scores "Fred")
(find scores "Fred")
(keys scores)
(vals scores)

; build map
(def players #{"Alice" "Bob" "Kelly"})
(zipmap players (repeat 0))
(into {} (map (fn [player] [player 0]) players))
(reduce (fn [m player]
          (assoc m player 0))
          {}
          players)

; combining maps
(def new-scores {"Angela" 300 "Jeff" 900})
(merge scores new-scores)
(def new-scores {"Fred" 550}
                {"Angela" 900}
                {"Sam" 1000})
(merge-with + scores new-scores)

; sorted maps
(def sm (sorted-map
        "Bravo" 204
        "Alfa" 35
        "Sigma" 99
        "Charlie" 100))

; representing application domain information
(def person
  {:first-name "Kelly"
   :last-name "Keen"
   :age 32
   :occupation "Programmer"})
(get person :occupation)
(person :occupation)
(:occupation person)
(:favorite-color person "beige")
(assoc person :occupation "Baker")

; nested entities
(def company
  {:name "widgeCo"
   :address {:street "123 Main St"
             :city "Springfield"
             :state "IL"}})
(get-in company [:address :city])
(assoc-in company [:address :street] "303 Broadway")

; Records
(defrecord Person [first-name last-name age occupation])
(def kelly (->Person "Kelly" "Keen" 32 "Programmer"))
(def kelly (map->Person
  {:first-name "Kelly"
   :last-name "Keen"
   :age 32
   :occupation "Programmer"}))
(:occupation kelly)
